home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / CDTools / MUIRexx / demos / MUIRexxDir / lhalist.rexx < prev    next >
OS/2 REXX Batch file  |  1996-12-03  |  1KB  |  53 lines

  1. /*
  2.  
  3. Code:       lhalist.rexx
  4. Author:     Russell Leighton
  5. Revision:   11 Jan 1996
  6.  
  7. Comments:   This script is used to display an lha archive list.  A
  8. requester id created and allows extraction of archive contents if a
  9. destination directory is selected.
  10.  
  11. */
  12.  
  13. options results
  14.  
  15. /* TAG ID definitions */
  16.  
  17. Dirlist_Directory =               0x8042ea41 /* V4  isg STRPTR            */
  18. Weight = '0x80421d1f'
  19.  
  20. parse arg portname' 'name
  21.  
  22. /* get archive listing */
  23. address command 'run >nil: lha > pipe:lha v "'name'"'
  24.  
  25. address VALUE portname
  26. group ID DIR REGISTER
  27. ndir = result
  28.  
  29. /* get destination directory */
  30. dirlist ID DIR||(3-ndir) ATTRS Dirlist_Directory
  31. ddir = import(d2c(result))
  32.  
  33. /* create window to display archive contents */
  34. window ID LHA TITLE '"Archive List"' COMMAND '"window ID LHA CLOSE"' PORT portname
  35. /* create view containing archive contents */
  36.     view FILE '"pipe:lha"'
  37. /* if destination directory exists then create a button */
  38.     if ddir ~= '' then do
  39.         group HORIZ
  40.             if lastpos('/',ddir) ~= length(ddir) then do
  41.                 if lastpos(':',ddir) ~= length(ddir) then ddir = ddir'/'
  42.             end
  43.             space HORIZ
  44.             button ATTRS Weight 0 COMMAND '"muidir:lhaextract 'portname' 'name' 'ddir'"' LABEL 'Extract to 'ddir
  45.             space HORIZ
  46.         endgroup
  47.     end
  48. endwindow
  49. /*
  50. address command 'delete >nil: T:lha.out QUIET'
  51. */
  52. return
  53.